<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude, ExistentialQuantification #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -funbox-strict-fields #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  GHC.IO.Encoding.Types</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow, 2008-2009</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- License     :  see libraries/base/LICENSE</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- </span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Stability   :  internal</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Portability :  non-portable</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Types for text encoding/decoding</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.IO.Encoding.Types</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier">BufferCodec</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier">TextEncoding</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>    </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoder"><span class="hs-identifier">TextEncoder</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextDecoder"><span class="hs-identifier">TextDecoder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>    </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodeBuffer"><span class="hs-identifier">CodeBuffer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#EncodeBuffer"><span class="hs-identifier">EncodeBuffer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#DecodeBuffer"><span class="hs-identifier">DecodeBuffer</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>    </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodingProgress"><span class="hs-identifier">CodingProgress</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-25"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Word.html"><span class="hs-identifier">GHC.Word</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Show.html"><span class="hs-identifier">GHC.Show</span></a></span><span>
</span><span id="line-30"></span><span class="hs-comment">-- import GHC.IO</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html"><span class="hs-identifier">GHC.IO.Buffer</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- Text encoders/decoders</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">data</span><span> </span><span id="BufferCodec"><span class="annot"><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-var">BufferCodec</span></a></span></span><span> </span><span id="local-6989586621679534233"><span class="annot"><a href="#local-6989586621679534233"><span class="hs-identifier hs-type">from</span></a></span></span><span> </span><span id="local-6989586621679534232"><span class="annot"><a href="#local-6989586621679534232"><span class="hs-identifier hs-type">to</span></a></span></span><span> </span><span id="local-6989586621679534231"><span class="annot"><a href="#local-6989586621679534231"><span class="hs-identifier hs-type">state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="BufferCodec"><span class="annot"><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-var">BufferCodec</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-37"></span><span>  </span><span id="encode"><span class="annot"><span class="annottext">forall from to state.
BufferCodec from to state -&gt; CodeBuffer from to
</span><a href="GHC.IO.Encoding.Types.html#encode"><span class="hs-identifier hs-var hs-var">encode</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodeBuffer"><span class="hs-identifier hs-type">CodeBuffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534233"><span class="hs-identifier hs-type">from</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534232"><span class="hs-identifier hs-type">to</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>   </span><span class="hs-comment">-- ^ The @encode@ function translates elements of the buffer @from@</span><span>
</span><span id="line-39"></span><span>   </span><span class="hs-comment">-- to the buffer @to@.  It should translate as many elements as possible</span><span>
</span><span id="line-40"></span><span>   </span><span class="hs-comment">-- given the sizes of the buffers, including translating zero elements</span><span>
</span><span id="line-41"></span><span>   </span><span class="hs-comment">-- if there is either not enough room in @to@, or @from@ does not</span><span>
</span><span id="line-42"></span><span>   </span><span class="hs-comment">-- contain a complete multibyte sequence.</span><span>
</span><span id="line-43"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-44"></span><span>   </span><span class="hs-comment">-- If multiple CodingProgress returns are possible, OutputUnderflow must be</span><span>
</span><span id="line-45"></span><span>   </span><span class="hs-comment">-- preferred to InvalidSequence. This allows GHC's IO library to assume that</span><span>
</span><span id="line-46"></span><span>   </span><span class="hs-comment">-- if we observe InvalidSequence there is at least a single element available</span><span>
</span><span id="line-47"></span><span>   </span><span class="hs-comment">-- in the output buffer.</span><span>
</span><span id="line-48"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-49"></span><span>   </span><span class="hs-comment">-- The fact that as many elements as possible are translated is used by the IO</span><span>
</span><span id="line-50"></span><span>   </span><span class="hs-comment">-- library in order to report translation errors at the point they</span><span>
</span><span id="line-51"></span><span>   </span><span class="hs-comment">-- actually occur, rather than when the buffer is translated.</span><span>
</span><span id="line-52"></span><span>  </span><span>
</span><span id="line-53"></span><span>  </span><span id="recover"><span class="annot"><span class="annottext">forall from to state.
BufferCodec from to state
-&gt; Buffer from -&gt; Buffer to -&gt; IO (Buffer from, Buffer to)
</span><a href="GHC.IO.Encoding.Types.html#recover"><span class="hs-identifier hs-var hs-var">recover</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534233"><span class="hs-identifier hs-type">from</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534232"><span class="hs-identifier hs-type">to</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534233"><span class="hs-identifier hs-type">from</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534232"><span class="hs-identifier hs-type">to</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-54"></span><span>   </span><span class="hs-comment">-- ^ The @recover@ function is used to continue decoding</span><span>
</span><span id="line-55"></span><span>   </span><span class="hs-comment">-- in the presence of invalid or unrepresentable sequences. This includes</span><span>
</span><span id="line-56"></span><span>   </span><span class="hs-comment">-- both those detected by @encode@ returning @InvalidSequence@ and those</span><span>
</span><span id="line-57"></span><span>   </span><span class="hs-comment">-- that occur because the input byte sequence appears to be truncated.</span><span>
</span><span id="line-58"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-59"></span><span>   </span><span class="hs-comment">-- Progress will usually be made by skipping the first element of the @from@</span><span>
</span><span id="line-60"></span><span>   </span><span class="hs-comment">-- buffer. This function should only be called if you are certain that you</span><span>
</span><span id="line-61"></span><span>   </span><span class="hs-comment">-- wish to do this skipping and if the @to@ buffer has at least one element</span><span>
</span><span id="line-62"></span><span>   </span><span class="hs-comment">-- of free space. Because this function deals with decoding failure, it assumes</span><span>
</span><span id="line-63"></span><span>   </span><span class="hs-comment">-- that the from buffer has at least one element.</span><span>
</span><span id="line-64"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-65"></span><span>   </span><span class="hs-comment">-- @recover@ may raise an exception rather than skipping anything.</span><span>
</span><span id="line-66"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-67"></span><span>   </span><span class="hs-comment">-- Currently, some implementations of @recover@ may mutate the input buffer.</span><span>
</span><span id="line-68"></span><span>   </span><span class="hs-comment">-- In particular, this feature is used to implement transliteration.</span><span>
</span><span id="line-69"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-70"></span><span>   </span><span class="hs-comment">-- @since 4.4.0.0</span><span>
</span><span id="line-71"></span><span>  </span><span>
</span><span id="line-72"></span><span>  </span><span id="close"><span class="annot"><span class="annottext">forall from to state. BufferCodec from to state -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#close"><span class="hs-identifier hs-var hs-var">close</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>   </span><span class="hs-comment">-- ^ Resources associated with the encoding may now be released.</span><span>
</span><span id="line-74"></span><span>   </span><span class="hs-comment">-- The @encode@ function may not be called again after calling</span><span>
</span><span id="line-75"></span><span>   </span><span class="hs-comment">-- @close@.</span><span>
</span><span id="line-76"></span><span>
</span><span id="line-77"></span><span>  </span><span id="getState"><span class="annot"><span class="annottext">forall from to state. BufferCodec from to state -&gt; IO state
</span><a href="GHC.IO.Encoding.Types.html#getState"><span class="hs-identifier hs-var hs-var">getState</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534231"><span class="hs-identifier hs-type">state</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-78"></span><span>   </span><span class="hs-comment">-- ^ Return the current state of the codec.</span><span>
</span><span id="line-79"></span><span>   </span><span class="hs-comment">--</span><span>
</span><span id="line-80"></span><span>   </span><span class="hs-comment">-- Many codecs are not stateful, and in these case the state can be</span><span>
</span><span id="line-81"></span><span>   </span><span class="hs-comment">-- represented as '()'.  Other codecs maintain a state.  For</span><span>
</span><span id="line-82"></span><span>   </span><span class="hs-comment">-- example, UTF-16 recognises a BOM (byte-order-mark) character at</span><span>
</span><span id="line-83"></span><span>   </span><span class="hs-comment">-- the beginning of the input, and remembers thereafter whether to</span><span>
</span><span id="line-84"></span><span>   </span><span class="hs-comment">-- use big-endian or little-endian mode.  In this case, the state</span><span>
</span><span id="line-85"></span><span>   </span><span class="hs-comment">-- of the codec would include two pieces of information: whether we</span><span>
</span><span id="line-86"></span><span>   </span><span class="hs-comment">-- are at the beginning of the stream (the BOM only occurs at the</span><span>
</span><span id="line-87"></span><span>   </span><span class="hs-comment">-- beginning), and if not, whether to use the big or little-endian</span><span>
</span><span id="line-88"></span><span>   </span><span class="hs-comment">-- encoding.</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span>  </span><span id="setState"><span class="annot"><span class="annottext">forall from to state. BufferCodec from to state -&gt; state -&gt; IO ()
</span><a href="GHC.IO.Encoding.Types.html#setState"><span class="hs-identifier hs-var hs-var">setState</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679534231"><span class="hs-identifier hs-type">state</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>   </span><span class="hs-comment">-- restore the state of the codec using the state from a previous</span><span>
</span><span id="line-92"></span><span>   </span><span class="hs-comment">-- call to 'getState'.</span><span>
</span><span id="line-93"></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-keyword">type</span><span> </span><span id="CodeBuffer"><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodeBuffer"><span class="hs-identifier hs-var">CodeBuffer</span></a></span></span><span> </span><span id="local-6989586621679534191"><span class="annot"><a href="#local-6989586621679534191"><span class="hs-identifier hs-type">from</span></a></span></span><span> </span><span id="local-6989586621679534190"><span class="annot"><a href="#local-6989586621679534190"><span class="hs-identifier hs-type">to</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534191"><span class="hs-identifier hs-type">from</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534190"><span class="hs-identifier hs-type">to</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodingProgress"><span class="hs-identifier hs-type">CodingProgress</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534191"><span class="hs-identifier hs-type">from</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#Buffer"><span class="hs-identifier hs-type">Buffer</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534190"><span class="hs-identifier hs-type">to</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span class="hs-keyword">type</span><span> </span><span id="DecodeBuffer"><span class="annot"><a href="GHC.IO.Encoding.Types.html#DecodeBuffer"><span class="hs-identifier hs-var">DecodeBuffer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodeBuffer"><span class="hs-identifier hs-type">CodeBuffer</span></a></span><span> </span><span class="annot"><a href="GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span>
</span><span id="line-97"></span><span class="hs-keyword">type</span><span> </span><span id="EncodeBuffer"><span class="annot"><a href="GHC.IO.Encoding.Types.html#EncodeBuffer"><span class="hs-identifier hs-var">EncodeBuffer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodeBuffer"><span class="hs-identifier hs-type">CodeBuffer</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="annot"><a href="GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-keyword">type</span><span> </span><span id="TextDecoder"><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextDecoder"><span class="hs-identifier hs-var">TextDecoder</span></a></span></span><span> </span><span id="local-6989586621679534189"><span class="annot"><a href="#local-6989586621679534189"><span class="hs-identifier hs-type">state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="annot"><a href="GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#CharBufElem"><span class="hs-identifier hs-type">CharBufElem</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534189"><span class="hs-identifier hs-type">state</span></a></span><span>
</span><span id="line-100"></span><span class="hs-keyword">type</span><span> </span><span id="TextEncoder"><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoder"><span class="hs-identifier hs-var">TextEncoder</span></a></span></span><span> </span><span id="local-6989586621679534187"><span class="annot"><a href="#local-6989586621679534187"><span class="hs-identifier hs-type">state</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#BufferCodec"><span class="hs-identifier hs-type">BufferCodec</span></a></span><span> </span><span class="annot"><a href="GHC.IO.Buffer.html#CharBufElem"><span class="hs-identifier hs-type">CharBufElem</span></a></span><span> </span><span class="annot"><a href="GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534187"><span class="hs-identifier hs-type">state</span></a></span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">-- | A 'TextEncoding' is a specification of a conversion scheme</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- between sequences of bytes and sequences of Unicode characters.</span><span>
</span><span id="line-104"></span><span class="hs-comment">--</span><span>
</span><span id="line-105"></span><span class="hs-comment">-- For example, UTF-8 is an encoding of Unicode characters into a sequence</span><span>
</span><span id="line-106"></span><span class="hs-comment">-- of bytes.  The 'TextEncoding' for UTF-8 is 'System.IO.utf8'.</span><span>
</span><span id="line-107"></span><span class="hs-keyword">data</span><span> </span><span id="TextEncoding"><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-var">TextEncoding</span></a></span></span><span>
</span><span id="line-108"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679534186"><span class="annot"><a href="#local-6989586621679534186"><span class="hs-identifier hs-type">dstate</span></a></span></span><span> </span><span id="local-6989586621679534185"><span class="annot"><a href="#local-6989586621679534185"><span class="hs-identifier hs-type">estate</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span id="TextEncoding"><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-var">TextEncoding</span></a></span></span><span>  </span><span class="hs-special">{</span><span>
</span><span id="line-109"></span><span>        </span><span id="textEncodingName"><span class="annot"><span class="annottext">TextEncoding -&gt; String
</span><a href="GHC.IO.Encoding.Types.html#textEncodingName"><span class="hs-identifier hs-var hs-var">textEncodingName</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-110"></span><span>                   </span><span class="hs-comment">-- ^ a string that can be passed to 'System.IO.mkTextEncoding' to</span><span>
</span><span id="line-111"></span><span>                   </span><span class="hs-comment">-- create an equivalent 'TextEncoding'.</span><span>
</span><span id="line-112"></span><span>        </span><span id="mkTextDecoder"><span class="annot"><span class="annottext">()
</span><a href="GHC.IO.Encoding.Types.html#mkTextDecoder"><span class="hs-identifier hs-var hs-var">mkTextDecoder</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextDecoder"><span class="hs-identifier hs-type">TextDecoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534186"><span class="hs-identifier hs-type">dstate</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-113"></span><span>                   </span><span class="hs-comment">-- ^ Creates a means of decoding bytes into characters: the result must not</span><span>
</span><span id="line-114"></span><span>                   </span><span class="hs-comment">-- be shared between several byte sequences or simultaneously across threads</span><span>
</span><span id="line-115"></span><span>        </span><span id="mkTextEncoder"><span class="annot"><span class="annottext">()
</span><a href="GHC.IO.Encoding.Types.html#mkTextEncoder"><span class="hs-identifier hs-var hs-var">mkTextEncoder</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoder"><span class="hs-identifier hs-type">TextEncoder</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679534185"><span class="hs-identifier hs-type">estate</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-116"></span><span>                   </span><span class="hs-comment">-- ^ Creates a means of encode characters into bytes: the result must not</span><span>
</span><span id="line-117"></span><span>                   </span><span class="hs-comment">-- be shared between several character sequences or simultaneously across threads</span><span>
</span><span id="line-118"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-comment">-- | @since 4.3.0.0</span><span>
</span><span id="line-121"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679534176"><span id="local-6989586621679534179"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="GHC.IO.Encoding.Types.html#TextEncoding"><span class="hs-identifier hs-type">TextEncoding</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-122"></span><span>  </span><span class="hs-comment">-- | Returns the value of 'textEncodingName'</span><span>
</span><span id="line-123"></span><span>  </span><span id="local-6989586621679534174"><span class="annot"><span class="annottext">show :: TextEncoding -&gt; String
</span><a href="GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span id="local-6989586621679534172"><span class="annot"><span class="annottext">TextEncoding
</span><a href="#local-6989586621679534172"><span class="hs-identifier hs-var">te</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextEncoding -&gt; String
</span><a href="GHC.IO.Encoding.Types.html#textEncodingName"><span class="hs-identifier hs-var hs-var">textEncodingName</span></a></span><span> </span><span class="annot"><span class="annottext">TextEncoding
</span><a href="#local-6989586621679534172"><span class="hs-identifier hs-var">te</span></a></span><span>
</span><span id="line-124"></span><span>
</span><span id="line-125"></span><span class="hs-comment">-- | @since 4.4.0.0</span><span>
</span><span id="line-126"></span><span class="hs-keyword">data</span><span> </span><span id="CodingProgress"><span class="annot"><a href="GHC.IO.Encoding.Types.html#CodingProgress"><span class="hs-identifier hs-var">CodingProgress</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="InputUnderflow"><span class="annot"><a href="GHC.IO.Encoding.Types.html#InputUnderflow"><span class="hs-identifier hs-var">InputUnderflow</span></a></span></span><span>  </span><span class="hs-comment">-- ^ Stopped because the input contains insufficient available elements,</span><span>
</span><span id="line-127"></span><span>                                      </span><span class="hs-comment">-- or all of the input sequence has been successfully translated.</span><span>
</span><span id="line-128"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="OutputUnderflow"><span class="annot"><a href="GHC.IO.Encoding.Types.html#OutputUnderflow"><span class="hs-identifier hs-var">OutputUnderflow</span></a></span></span><span> </span><span class="hs-comment">-- ^ Stopped because the output contains insufficient free elements</span><span>
</span><span id="line-129"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="InvalidSequence"><span class="annot"><a href="GHC.IO.Encoding.Types.html#InvalidSequence"><span class="hs-identifier hs-var">InvalidSequence</span></a></span></span><span> </span><span class="hs-comment">-- ^ Stopped because there are sufficient free elements in the output</span><span>
</span><span id="line-130"></span><span>                                      </span><span class="hs-comment">-- to output at least one encoded ASCII character, but the input contains</span><span>
</span><span id="line-131"></span><span>                                      </span><span class="hs-comment">-- an invalid or unrepresentable sequence</span><span>
</span><span id="line-132"></span><span>                    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621679534165"><span id="local-6989586621679534167"><span class="annot"><span class="annottext">CodingProgress -&gt; CodingProgress -&gt; Bool
(CodingProgress -&gt; CodingProgress -&gt; Bool)
-&gt; (CodingProgress -&gt; CodingProgress -&gt; Bool) -&gt; Eq CodingProgress
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: CodingProgress -&gt; CodingProgress -&gt; Bool
$c/= :: CodingProgress -&gt; CodingProgress -&gt; Bool
== :: CodingProgress -&gt; CodingProgress -&gt; Bool
$c== :: CodingProgress -&gt; CodingProgress -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span>   </span><span class="hs-comment">-- ^ @since 4.4.0.0</span><span>
</span><span id="line-133"></span><span>                             </span><span class="hs-special">,</span><span> </span><span id="local-6989586621679534158"><span id="local-6989586621679534160"><span id="local-6989586621679534162"><span class="annot"><span class="annottext">Int -&gt; CodingProgress -&gt; ShowS
[CodingProgress] -&gt; ShowS
CodingProgress -&gt; String
(Int -&gt; CodingProgress -&gt; ShowS)
-&gt; (CodingProgress -&gt; String)
-&gt; ([CodingProgress] -&gt; ShowS)
-&gt; Show CodingProgress
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [CodingProgress] -&gt; ShowS
$cshowList :: [CodingProgress] -&gt; ShowS
show :: CodingProgress -&gt; String
$cshow :: CodingProgress -&gt; String
showsPrec :: Int -&gt; CodingProgress -&gt; ShowS
$cshowsPrec :: Int -&gt; CodingProgress -&gt; ShowS
</span><a href="GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span> </span><span class="hs-comment">-- ^ @since 4.4.0.0</span><span>
</span><span id="line-134"></span><span>                             </span><span class="hs-special">)</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span></pre></body></html>